home *** CD-ROM | disk | FTP | other *** search
/ PCMania 64 / PCMania CD64_1.iso / phy / phy006 / lowlevel / miracs.asm < prev    next >
Encoding:
Assembly Source File  |  1997-08-29  |  2.8 KB  |  93 lines

  1. .model tiny
  2. locals
  3. .386
  4. .code
  5.  
  6. ORG     0050h
  7.  
  8. Main                    proc
  9.                         push    di
  10.                         push    es
  11.                         push    cs
  12.                         pop     es
  13.                         push    cs
  14.                         pop     ds
  15.                         mov     ax, cs
  16.                         mov     di, offset RegAX
  17.                         call    Ponlo
  18.                         pop     es
  19.                         mov     ax, es
  20.                         push    cs
  21.                         pop     es
  22.                         mov     di, offset RegBX
  23.                         call    Ponlo
  24.                         mov     ax, cx
  25.                         mov     di, offset RegCX
  26.                         call    Ponlo
  27.                         mov     ax, dx
  28.                         mov     di, offset RegDX
  29.                         call    Ponlo
  30.                         mov     ax, si
  31.                         mov     di, offset RegSI
  32.                         call    Ponlo
  33.                         pop     di
  34.                         mov     ax, di
  35.                         mov     di, offset RegDI
  36.                         call    Ponlo
  37.                         mov     ax, bp
  38.                         mov     di, offset RegBP
  39.                         call    Ponlo
  40.                         mov     ah, 09
  41.                         mov     dx, offset Mensaje
  42.                         int     21h
  43.                         mov     ax, 4c00h
  44.                         int     21h
  45. Main                    endp
  46.  
  47. Ponlo                   proc
  48.                         mov     byte ptr [control], 0
  49.                         jmp     Salto
  50.            Salto2:      mov     byte ptr [control], 1
  51.            Salto:       push    ax
  52.                         push    bx
  53.                         mov     bx, offset Numero
  54.                         mov     al, ah
  55.                         and     ax, 0f00fh
  56.                         ror     ah, 4
  57.                         xchg    ah, al
  58.                         xlat
  59.                         stosb
  60.                         xchg    ah, al
  61.                         xlat
  62.                         stosb
  63.                         pop     bx
  64.                         pop     ax
  65.                         cmp     byte ptr [control], 1
  66.                         jz      Acaba
  67.                         xchg    ah, al
  68.                         jmp     Salto2
  69.             Acaba:      ret
  70. Ponlo                   endp
  71.  
  72. Numero  db      '0123456789ABCDEF'
  73.  
  74. Control db      0
  75.  
  76. Mensaje db 'AX='
  77. RegAX   dd 0
  78.         db ' BX='
  79. RegBX   dd 0
  80.         db ' CX='
  81. RegCX   dd 0
  82.         db ' DX='
  83. RegDX   dd 0
  84.         db ' SI='
  85. RegSI   dd 0
  86.         db ' DI='
  87. RegDI   dd 0
  88.         db ' BP='
  89. RegBP   dd 0
  90.         db '$'
  91.  
  92.                         end     Main
  93.